package org.extreme.schooltalk.parsing;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import org.extreme.schooltalk.CommonUtils;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;

import android.util.Log;


public class SaxHandler {
	
	XMLReader reader = null;
	public static final String _ITEM = "item";
	
	
	public SaxHandler(DefaultHandler dHandler,InputStream input) throws Exception{
		
			SAXParserFactory factory = SAXParserFactory.newInstance();
			SAXParser parser = factory.newSAXParser();
			reader = parser.getXMLReader();
			reader.setContentHandler(dHandler);
			if(input!=null){
				reader.parse(new InputSource(input));
				input.close();
			}
	}
	
	
	
}

